﻿using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine.Animation.ColorAnimation;
using Transformable_Engine_v2.Engine.Animation.PositionAnimation;
using Transformable_Engine_v2.Engine.Animation.RotationAnimation;
using Transformable_Engine_v2.Engine.Animation.ScaleAnimation;
using Transformable_Engine_v2.Engine.Animation.Trajectory;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Helper;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.Particle.RandomObjectExplosion
{
    public class Smoke : ImageContainer
    {
         public Smoke(TE_Vector2 direction)
         {
             Sprite = ParticleSheet.GetSprite(ParticleSheet.Smoke.Smoke);
             Origin = TE_Rectangle.Alignment.CenterMiddle;
             Color = new Color(Color.White, 150);

             float speed = Randomizer.Float(2, 4);
             AddAnimations(new PositionAnimation(new QuadraticEasing(BaseTrajectory.Easing.EaseOut), direction * speed, 600, false, 0));

             float scale = Randomizer.Float(1, 2f);

             Scale = new TE_Vector2(scale, scale);
             AddAnimations(new ColorAnimation(new LinearEasing(), Color.Transparent, 500, false, 500));
             AddAnimations(new RotationUniformLinearAnimation(0, Randomizer.Double(0.5, 1.5)));
             AddAnimations(new ScaleAnimation(new LinearEasing(), TE_Vector2.Zero, 1000, false, 0));

             Die(1000);
         }
    }
}